<?php
/**
 * Created by dutuwang.net
 * User: adophper <hello@adophper.com>
 * Date: 2018/4/9
 * Time: 17:07
 */
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

$this->title = $title;

?>
<!--内页注册1-->
<div class="min_register contBox">
    <h5>尊敬的用户，请补全以下信息，将获取更多资讯</h5>
    <div class="min_register_box">
        <?php
        $form = ActiveForm::begin([
            'id' => 'company-form'
        ])
        ?>
        <div class="hidden">
            <?=$form->field($model, 'status')->hiddenInput(['value' => 1])->label(false)?>
        </div>
        <div class="min_register_item clearfix gs_reg_item">
            <label class="col-lg-3 col-md-3 col-sm-2">真实姓名：</label>
            <div class="col-lg-7 col-md-7 col-sm-8">
                <input type="text" name="realname" class="form_edit" value="<?=$user->realname?>" />
            </div>
        </div>
        <div class="min_register_item clearfix gs_reg_item">
            <label class="col-lg-3 col-md-3 col-sm-2">手机号码：</label>
            <div class="col-lg-7 col-md-7 col-sm-8"><?=$user->mobile?></div>
        </div>
        <div class="min_register_item clearfix gs_reg_item">
            <label class="col-lg-3 col-md-3 col-sm-2">电子邮箱：</label>
            <div class="col-lg-9 col-md-9 col-sm-10">
                <div class="row clearfix">
                    <div class="col-lg-6 col-md-6 col-sm-6">
                        <input type="text" class="form_edit" name="email" id="email" value="<?=$user->email?>" />
                    </div>
                    <div class="col-lg-3 col-md-3 col-sm-3">
                        <em class="t_red">*</em>
                        <!--<span class="ml15 mr15">(未验证)</span>
                        <a>立即验证</a>-->
                    </div>
                </div>
            </div>
        </div>
        <div class="min_register_item clearfix gs_reg_item">
            <label class="col-lg-3 col-md-3 col-sm-2">公司名称：</label>
            <div class="col-lg-7 col-md-7 col-sm-8">
                <?=$form->field($model, 'name')->textInput(['class' => 'form_edit'])->label(false)?>
            </div>
        </div>
        <div class="min_register_item clearfix gs_reg_item">
            <label class="col-lg-3 col-md-3 col-sm-2">公司网址：</label>
            <div class="col-lg-7 col-md-7 col-sm-8">
                <?=$form->field($model, 'url')->textInput(['class' => 'form_edit'])->label(false)?>
            </div>
        </div>
        <div class="min_register_item clearfix gs_reg_item">
            <label class="col-lg-3 col-md-3 col-sm-2">公司电话：</label>
            <div class="col-lg-7 col-md-7 col-sm-8">
                <?=$form->field($model, 'telphone')->textInput(['class' => 'form_edit'])->label(false)?>
            </div>
        </div>
        <div class="min_register_item clearfix gs_reg_item">
            <label class="col-lg-3 col-md-3 col-sm-2">公司传真：</label>
            <div class="col-lg-7 col-md-7 col-sm-8">
                <?=$form->field($model, 'fax')->textInput(['class' => 'form_edit'])->label(false)?>
            </div>
        </div>
        <div class="min_register_item clearfix gs_reg_item">
            <label class="col-lg-3 col-md-3 col-sm-2">主营产品：</label>
            <div class="col-lg-7 col-md-7 col-sm-8">
                <?=$form->field($model, 'product')->textInput(['class' => 'form_edit'])->label(false)?>
            </div>
            <span>多个请用","分割</span>
        </div>
        <div class="min_register_item clearfix gs_reg_item">
            <label class="col-lg-3 col-md-3 col-sm-2">展会分类：</label>
            <div class="col-lg-7 col-md-7 col-sm-8 clearfix">
                <?=$form->field($model, 'category_id')->dropDownList($category, ['id' => 'category_id', 'class' => 'form_edit'])->label(false)?>
            </div>
            <span class="t_red">*</span>
        </div>
        <div class="min_register_item clearfix gs_reg_item">
            <label class="col-lg-3 col-md-3 col-sm-2"></label>
            <div class="col-lg-7 col-md-7 col-sm-8">
                <a href="<?=Yii::$app->urlManager->createUrl(['page/feedback'])?>">找不到符合您的行业分类？赶紧告诉我们吧</a>
            </div>
        </div>
        <div class="min_register_btn flex f_center">
            <?=Html::submitButton("确认提交", ['class' => 'btn_red', 'id' => 'submit'])?>
        </div>
        <?php
        ActiveForm::end();
        ?>
    </div>
</div>
<script>
$(function () {
    $("#submit").on('click', function(e){
        var email = $("#email").val();
        if (!isEmail(email)) {
            alert('请输入正确的电子邮箱');
            return false;
        }
        $("#company-form").data('yiiActiveForm').validated = true;
    })
})
</script>
